const { DataTypes } = require('sequelize');
const sequelize = require('../db');

exports.adminModel = sequelize.define(
	'admin',
	{
		loginId: {
			type: DataTypes.STRING,
			allowNull: false,
			comment: '账号'
		},
		loginPwd: {
			type: DataTypes.STRING,
			allowNull: false,
			comment: '密码'
		},
		name: {
			type: DataTypes.STRING,
			allowNull: false,
			comment: '昵称'
		}
	},
	{
		freezeTableName: true,
		deletedAt: true,
		// createdAt: 'createdDate',
		defaultScope: {
			attributes: { exclude: ['createdAt', 'updatedAt'] } // 默认排除 createdAt 和 updatedAt 字段
		}
	}
);
